import {servers} from "../index.ts"
import type {IUser} from '@/global/type'

// 获取token信息
const getuserTokenApi = async <T>(data: IUser  ) => {
  const res = await servers.request<T>({
    url: '/api/user/login',
    method: "post",
    data: {
      ...data
    }
  })
  return res
}
const getUserInfoApi = async <T> (token: string) => {
  const res = await servers.request<T>({
    url: "/api/user/userInfo",
    method: "post",
    data: {
      token
    }
  })
  return res
}
export {
  getuserTokenApi,
  getUserInfoApi
}